home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Special 25
/
AMIGAplus Sonderheft 25 (2000)(Falke)(DE)(Track 1 of 4)[!].iso
/
PublicDomain
/
Anwendungen
/
Miggy
/
Miggy.doc
< prev
next >
Wrap
Text File
|
1999-11-17
|
15KB
|
394 lines
--------------------------------------------------------------------------
Initial release by Olly 18-Nov-99
--------------------------------------------------------------------------
Miggy - Yet another attempt at artificial intelligence :)
PROGRAM HISTORY: (a must read!)
----------------
Late '89 (<- True!)
Purchase of new A500, began with (Yuk!) AmigaBasic, started working with
specific responses to user input. After 15 mins coding, my brain
subconciously calculated a large number beginning with 5 and many decimal
places concerning the number of specific responses required before project
completion. Needless to say, scrapped!
Early '90
Changed coding language to ASM.
*Large time-warp here - Left Army in mid '95*
11-05-99
After MANY projects and a BBS filebase (FB11 - Max's), I came across a
project from Aminet called HAL9001 V1.42 by Simon Champion, written late
'98 in Amos Pro. His idea was a step forward, to output responses using a
certain formula based on Nouns and Verbs. Amos being a somewhat buggy and
unstable language, I couldn't get it to reply a single sentence without
crashing with a dead-end (80000006) alert every time, but it started me
thinking.
12-05-99
24 hour thinktank. Experimented with a few routines. Input parser routine
complete. Working out file formats (preferably editable ASCII), basic
program structure complete. Can't sleep.
13-05-99
Main problem with this kind of program is that 90% completion is required
before first test can be established. Ran a few tests - deemed fairly
successful. Did some more tweaking, doesn't crash randomly anymore :)
14-05-99
Complete! Miggy uses particular files based on mood and emotion, such as
good and bad subject, happy and sad etc. Words in dictionary require their
own mood/emotion and meaning. Responses gleaned from these facts. Miggy
has the ability to learn. Responses randomly fetched once mood/emotion is
determined. Code pretty patched and messy though :(
Program upkeep difficult, as later stages of testing showed. Program
ability to learn hampered by requirement of many more moods/emotions than
originally catered for. Therefore, brain recalculates number - result much
smaller this time, albeit still too large for practicality. Especially
when in "Learn" mode, too cumbersome to teach and too many variables based
on what mood/meaning I myself deem a particular word to have and what
someone else does. Hmm.. Scrapped! (again)
15-05-99
Major rethink. Need to cut down on number of files used. Also want to
cater for different languages, as I would like to see this program spread
worldwide with users creating either their own or adding to existing
files in their own language. "Learn" mode must be simplistic, as users
might tire of this and leave it alone. Decided to keep input parsing
routine as it worked fine. :þ What kind of algorithm is required to
calculate an appropriate response? Is this the kind of thing that lonely
people do? Is this concept possible at all? [sigh].. Still can't sleep.
16-05-99
Some more experimentation with ideas and routines. Major routines
reworked completely to cater for file formats. Attempting to maintain
maximum speed for when datafiles grow large. How many words in the English
(or then again, any other) language? 65,535 should be enough, as most
English dictionaries only contain about 30,000 or so. Response parser
EXTREMELY fast but has spurious problems I'm unable to pin down. Memory
requirements reduced massively (to 8848 bytes!) by slowing down response
parser slightly. Some more teeny bugs squished.
17-05-99
Prettied up the output, tested some more. Found another bug that was
subsequently squished. 2 major sub-routines placed in-line to help
fatter processors with instruction caches. After more testing, determined
that random response-fetch routine too hit and miss. Replaced with smaller
and more intelligent method.
Complete! The fully reworked Miggy now works fine without any crashing or
wierd binary output. Fully customizable for most languages with minimal
memory requirements. Even with little data in files responses becoming
intelligent. Should work on Kick 1.3 machines as well (does 1.3 understand
the assign "PROGDIR:"? If not - assign it :) Executable size under 2K.
---------------------------------------------------------------------------
So now you know what this project is all about. If you didn't read the
program history, I strongly suggest you do so. I'll stop typing in the
meantime..
All righty then! Maybe the next question is WHY? I dunno really, because
it was there - or maybe it wasn't. I've seen a few of these programs
floating around for some time, but none of them held my attention for very
long, as the responses calculated (assumed?) didn't appear too intelligent
but rather more convoluted, and Deep Blue (the chess champion) is WAY outta
my price range and also lacks personality.
In any case - the deed has been done. At this time I consider Miggy to be
capable of simple hello, goodbye, yes & no type conversations with little
available data. After some more time has been spent teaching it, Miggy's
able to create better matches due to greater availablity of data and wider
choice. I would like to see its capabilities with a large (1+ meg)
response file!
STARTING MIGGY:
---------------
Miggy is a CLI only program - there's no icon. If you add an icon and
start it then it's sure to crash as I didn't build it to be started that
way. Create a script that calls Miggy then start the script with an icon
that calls C:IconX if you must have an icon for it.
From the CLI, type DH1:Miggy/Miggy, or wherever it lives.
It will load its MiggyText file, Dictionary and Response file. You'll then
be faced with a "->" prompt. From here just type "Hello" for example, and
you'll be on your way.
The input parser knows only 2 commands:
"#l" - Enter "Learn" mode (See: TEACHING)
"#q" - Quit
The maximum input length Miggy reads at any prompt is 75 characters.
Total memory requirements are:
8848 + Dictionary file length + Response file length.
The MiggyText file looks like this:
---------------------------------------------------------------------------
Miggy V1.00 © Olly Koenders Australia 17-05-99.
Loading reference files..
Dictionary words:
Response records:
Learn mode activated - Type word/sentence to learn..
Type 3 generic responses: 1st-Vague, 2nd-Semi coherent, 3rd-Understanding
Learn mode deactivated.
Match:
abcdefghijklmnopqrstuvwxyz';:>8^-()þ]}
ABCDEFGHIJKLMNOPQRSTUVWXYZ';:>8^-()þ]}
---------------------------------------------------------------------------
These lines can be edited to your liking/language. I wonder if any lamers
will put their own name at the top..? There MUST be 10 lines and each line
MUST end with a 0x0a/#10/linefeed or expect problems.
THE INPUT PARSER:
-----------------
..is the "->" prompt. From here anything you type will be split into
single words, and these characters:
abcdefghijklmnopqrstuvwxyz';:>8^-()þ]}
..if found in the input will be changed into these:
ABCDEFGHIJKLMNOPQRSTUVWXYZ';:>8^-()þ]}
Any others will be masked so that only the characters from the second line
will end up in the dictionary. Typing "Hello,there!" will become
"HELLO THERE " and entering "You're not" will become "YOU'RE NOT". The
format for these 2 lines must be:
lowercasecharactersinyourlanguage+anyothersyouwant
UPPERCASECHARACTERSINYOURLANGUAGE+anyothersyouwant
All lowercase characters in the first line must correspond to the uppercase
characters in the second. The apostrophe "'" is there for words like
"Can't" etc., and the others are for smileys. :)
Uppercasing the input words is essential as the computer sees "This" and
"THIS" as 2 completely different things.
I recommend you don't add "!" or "?" as they are normally posted at the end
of a word, and words like "YES" and "YES!" will end up in the Dictionary -
they are the same thing.
Miggy will attempt to respond the best way it can determined by your input
and the input of others from previous sessions.
TEACHING:
---------
Ok, in order to teach, we need to know how Miggy